using System;
using System.Diagnostics.Contracts;

namespace OpenWaves.ImageTransformations.Web
{
    [ContractClass(typeof(WebImageTransformationServiceContract))]
    [DefaultImplementation(typeof(WebImageTransformationService))]
    public interface IWebImageTransformationService
    {
        Url GetTransformedImageUrl(Url imageUrl, IImageTransformation transformation);        
    }

    [ContractClassFor(typeof(IWebImageTransformationService))]
    abstract class WebImageTransformationServiceContract : IWebImageTransformationService
    {
        public Url GetTransformedImageUrl(Url imageUrl, IImageTransformation transformation)
        {
            Contract.Requires<ArgumentNullException>(imageUrl != null);
            Contract.Requires<ArgumentNullException>(transformation != null);
            Contract.Ensures(Contract.Result<Url>() != null);

            throw new NotImplementedException();
        }
    }
}